<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="">
    <style>
        .account {
            width: 600px;
            margin: 0 auto;
            padding: 14px;

        }

    </style>

</head>
<body>
<div class="account">
    <h1 style="text-align: center">注册</h1>
    <form>
        {% for field in form %}
            {% if field.name == 'code' %}
            <div class="form-group">
                <label for="{{ field.id_for_label }}">{{ field.label }}</label>

                {#                    <input type="email" class="form-control" id="inputEmail3" placeholder="Email">#}
                <div class="clearfix">
                    <div class="col-md-6" style="padding: 0">{{ field }}</div>
                    <div class="col-md-6"><input type="submit" class="btn btn-default" value="点击获取验证码 "></div>
                </div>

            </div>
            {% else %}
            <div class="form-group">
                <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                {#                    <input type="email" class="form-control" id="inputEmail3" placeholder="Email">#}
                {{ field }}
            </div>
            {% endif %}
        {% endfor %}
        <button type="submit" class="btn  btn-primary" onclick="regisiterAjaxSend();">注册</button>
    </form>
</div>


</div>

</form>
<script src="/static/js/jquery-3.6.0.js"></script>
<script>
    function regisiterAjaxSend() {
        $.ajax({
            url:'/ajax_send_msg/',
        })
    }
</script>
</body>
</html>